import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;



/**
 * @author 帅小伙
 * @date 2022/1/2
 * @description
 */
public class RabbitMqUtils {

    public static Channel  getChannel( ) throws Exception {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("47.96.19.90");
        factory.setUsername("mubei");
        factory.setPassword("020323");
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();
        return channel;
    }


    public static Connection  getConnection( ) throws Exception {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("47.96.19.90");
        factory.setUsername("mubei");
        factory.setPassword("020323");
        Connection connection = factory.newConnection();
        return connection;
    }
}
